function searchForm(){
	
	document.indexForm.submit()
	}
	
	function ChlidsearchForm(){
	
	document.ChlidindexForm.submit()
	}
	
	
	function selectAll(){
	var checkall = document.getElementById('checkall');
	var listsize = document.getElementById('listsize').value;
	for(var i=0;i<listsize;i++){
		if(checkall.checked){
			document.getElementById('checkone'+i).checked = true;
		}else{
			document.getElementById('checkone'+i).checked = false;
		}
	}
}
	function delNewsInfo(){
 
 	var listsize = document.getElementById('listsize').value;
	var pkid_string = '';
 
	var down_class='0';
	for(var i=0;i<listsize;i++){
		if(document.getElementById('checkone'+i).checked){
			pkid_string += document.getElementById('checkone'+i).value+'|';
 
		  var ifdown= document.getElementById('hasdown'+i);
			if(ifdown !=null && ifdown.value=='1')
			{
			   down_class =1;
			}	
			
		}
	}
	if(pkid_string == ''){
		alert('请至少选择一条!');
		return false;
	}
	document.getElementById('pkid').value = pkid_string;
	document.indexForm.action='/doTradeReg.do';
 
  
  if(down_class == 1)
  {
		  if(confirm("所选中含有下级分类，删除时下级分类也会一并删除！"))
		  {
		    document.indexForm.submit();
	    }
	} 
	else 
	{
		 if(window.confirm('确认删除吗?'))
		 {
		   document.indexForm.submit();
	   }
	}	
}

function delOneNews(val1,val2){
	
	  var ifdown= document.getElementById('hasdown'+val1);
		
		if(ifdown !=null && ifdown.value=='1')
		{
			if(confirm("所选中含有下级分类，删除时下级分类也会一并删除！"))
		  {
		     window.location.href='/doTradeReg.do?pkid='+val2+'&bpm_id=4162';
	    }		
	  }	
		else	 
		{ 
        if(window.confirm('确认删除吗?')
)
        {
       	  window.location.href='/doTradeReg.do?pkid='+val2+'&bpm_id=4162'; 
        } 		
    }
	
} 
	/*jQuery.noConflict();
		jQuery(function() {
			jQuery("#table_title_bg tr").click(function() {
				hideOrShow(this);
				
			});
		});
		
		function 	hideOrShow(val){
			var imgA = '/program/admin/images/2.gif';
			var imgB = '/program/admin/images/_2.gif';
			var trade_id = jQuery(val).attr("id");
			if(document.getElementById("img"+trade_id).src==imgA){
				document.getElementById("img"+trade_id).src=imgB;
			}else{
			  document.getElementById("img"+trade_id).src=imgA;
			}
			var this_id = jQuery("#this_id").val();
			var this_val= jQuery("#this_val").val();
			var cat_name = jQuery(val).attr("name");
			alert("========this_id============"+this_id);
			alert("========this_val============"+this_val);
			alert("========cat_name============"+cat_name);
			var all_tr=document.getElementsByTagName("tr");
			for(var i=0;i<all_tr.length;i++){
				var tr_name = jQuery(all_tr[i]).attr("name");
				var tr_id = jQuery(all_tr[i]).attr("id");
				if(tr_name!=undefined){
					if(tr_name.indexOf(cat_name) > -1 && tr_name!=cat_name ){
					  if(this_val=='0'){
					    jQuery("#"+tr_id).hide();
					    document.getElementById("this_val").value = '1';
					    document.getElementById("this_id").value = trade_id;
						}else{
							if(this_id == trade_id){
								jQuery("#"+tr_id).show();
								document.getElementById("img"+tr_id).src=imgB;
							  document.getElementById("this_val").value = '0';
							}else{
								jQuery("#"+tr_id).hide();
						    document.getElementById("this_val").value = '1';
						    document.getElementById("this_id").value = trade_id;
							}
						}
					}
				}
			}
	 }*/